package com.my.admin.api;

import com.my.admin.service.ImageTypeService;
import com.my.admin.util.Rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "图片类型接口", tags = "图片类型接口")
@RestController
@RequestMapping("api")
@CrossOrigin
public class ImageTypeApiController {

    @Autowired
    private ImageTypeService service;

    @ApiOperation("获取图片类型列表")
    @GetMapping("imageType/list")
    public Rest list() {
        return Rest.ok().setData("imageTypes", service.list());
    }

}
